package com.ynunicom.midplatform.common.config;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Bean 注册类
 *
 * @author duwei
 */
@Configuration
public class BeanConfiguration {

    @Bean
    public RestTemplate restTemplate(RestTemplateBuilder builder) {
        return builder
                //连接超时为10s
                .setConnectTimeout(10 * 1000)
                //请求超时为1分钟
                .setReadTimeout(60 * 1000)
                .build();
    }
}